<?php

require_once("./include/include.php");


$sql_name = $_SESSION["username"];
$sql = "SELECT * FROM user WHERE username = '$sql_name'";

$result = mysql_query($sql);
$row = mysql_fetch_assoc($result);
$useArr = $row;


<!--//    var_dump($_POST);-->
<!--if (!empty($_POST["save"]) && $_POST["save"] == "保存资料") {-->
  <!--$Email = $_POST["Email"];-->
  <!--$qq = $_POST["QQ"];-->
  <!--$address = $_POST["address"];-->
  <!--$mobile = $_POST["mobile"];-->
<!--//        var_dump($_POST);die;-->
  <!--$sql_insert = "UPDATE user SET Email = '$Email', QQ = '$qq', address = '$address', mobile = '$mobile' WHERE username = '$sql_name'";-->
<!--//        echo $sql_insert;die;-->
  $result_insert = mysql_query($sql_insert);
  if ($result_insert) {
	echo "<script> alert ('修改成功！'); window.location.href = 'user_setting.php'; </script>";
  }
}
?>
<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <title>账户设置</title>
  <link rel="stylesheet" href="css/user_setting.css">
</head>
<body>
<div class="container">
    <include file="./Home/Tpl/public/header.html" />
  <div class="banner">
	<img src="images/cases_banner.gif" alt="">
  </div>
  <div class="main">
	<div class="main_title">
	  <a href="#">首页</a>
	  <span>></span>
	  <a href="#">用户中心</a>
	  <span>></span>
	  <a href="#">账户设置</a>
	</div>
	<div class="main_top">
	  <div class="con_left fl">
		<p class="username">
		  <span><?php echo $_SESSION['username']; ?></span>
		</p>

		<p>
		  <a href="user_center.php" target="_blank">基本信息<span>></span></a>
		</p>

		<p>
		  <a href="#">账号设置<span>></span></a>
		</p>
	  </div>
	  <div class="con_right fr">
		<div class="user_info">
		  <span>基本信息</span>
		  <span>账号设置</span>
		</div>
		<div class="con_right_info">
		  <form action="user_setting.php" method="post">
			<table>
			  <tr>
				<td align="right">真实姓名 :</td>
				<td><input type="text" name="username" value="<?php echo $useArr['username']; ?>"></td>
			  </tr>
			  <tr>
				<td align="right">性别 :</td>
				<td>
				  <select name="sex" id="">
					<option value="boy">男</option>
					<option value="girl">女</option>
				  </select>
				</td>
			  </tr>
			  <tr>
				<td align="right">年龄 :</td>
				<td><input type="text" name="age" value="<?php echo $useArr['age']; ?>"></td>
			  </tr>
			  <tr>
				<td align="right">手机 :</td>
				<td><input type="text" name="mobile" value="<?php echo $useArr['mobile']; ?>"></td>
			  </tr>
			  <tr>
				<td align="right">邮箱 :</td>
				<td><input type="text" name="Email" value="<?php echo $useArr['Email']; ?>"></td>
			  </tr>
			  <tr>
				<td align="right">QQ :</td>
				<td><input type="text" name="QQ" value="<?php echo $useArr['QQ']; ?>"></td>
			  </tr>
			  <tr>
				<td align="right">详细地址 :</td>
				<td><input type="text" name="address" value="<?php echo $useArr['address']; ?>"></td>
			  </tr>
			</table>
			<p>
			  <input class="save" name="save" type="submit" value="保存资料"/>
			</p>
		  </form>
		</div>
	  </div>
	</div>
  </div>
    <include file="./Home/Tpl/public/footer.html" />
</div>
</body>
</html>